home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / mlock.z / mlock
Encoding:
Text File  |  1998-10-20  |  5.6 KB  |  132 lines

  1.  
  2.  
  3.  
  4. mmmmlllloooocccckkkk((((3333CCCC))))                                                            mmmmlllloooocccckkkk((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_llll_oooo_cccc_kkkk, _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk - lock or unlock pages in memory
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>>
  14.      _iiii_nnnn_tttt _mmmm_llll_oooo_cccc_kkkk_((((_cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_))))_;;;;
  15.      _iiii_nnnn_tttt _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_((((_cccc_oooo_nnnn_ssss_tttt _vvvv_oooo_iiii_dddd _****_a_d_d_r_,,,, _ssss_iiii_zzzz_eeee______tttt _l_e_n_))))_;;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _mmmm_llll_oooo_cccc_kkkk locks the pages associated with the address range (_a_d_d_r, _a_d_d_r +
  19.      _l_e_n) into memory.  The super-user can lock as many pages as it wishes,
  20.      other users are limited to a per process maximum {_P_L_O_C_K__M_A_X}. Locks
  21.      established with _mmmm_llll_oooo_cccc_kkkk are not inherited by a child process after a _ffff_oooo_rrrr_kkkk.
  22.  
  23.      _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk unlocks the pages associated with the address range (_a_d_d_r, _a_d_d_r +
  24.      _l_e_n), regardless of the number of times the pages were locked. Page locks
  25.      established by other processes are unaffected, when the pages are shared
  26.      amongst multiple processes.
  27.  
  28.      Address _a_d_d_r is not required to be page aligned, as the system
  29.      automatically rounds the address down to the nearest page boundary.
  30.  
  31.      _mmmm_llll_oooo_cccc_kkkk or _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk will fail if one or more of the following are true:
  32.  
  33.      [EAGAIN]    There was insufficient lockable memory to lock the entire
  34.                  address range (_a_d_d_r, _a_d_d_r + _l_e_n).  This may occur even though
  35.                  the amount requested was less than the system-imposed maximum
  36.                  number of locked pages.
  37.  
  38.      [EBUSY]     _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk will fail with this error if the address range
  39.                  specified has some active I/O initiated by some other process
  40.                  belonging to same share group.
  41.  
  42.      [ENOMEM]    The addresses specified by (addr, addr + len) are not mapped
  43.                  into the user's address space.
  44.  
  45.      [ENOMEM]    The caller was not super-user and the number of pages to be
  46.                  locked exceeded the per process limit {_P_L_O_C_K__M_A_X} [see
  47.                  _iiii_nnnn_tttt_rrrr_oooo(2)].
  48.  
  49.      [ENOMEM]    The total number of pages locked by the caller would exceed
  50.                  the maximum resident size for the process [see _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  51.  
  52.      [ENOSPC]    The address range (_a_d_d_r, _a_d_d_r + _l_e_n) contains a memory-mapped
  53.                  file, and there is insufficient space on the device to
  54.                  allocate the entire file.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. mmmmlllloooocccckkkk((((3333CCCC))))                                                            mmmmlllloooocccckkkk((((3333CCCC))))
  70.  
  71.  
  72.  
  73. SEE ALSO
  74.      exec(2), exit(2), fork(2), mlockall(3C), munlockall(3C), mmap(2),
  75.      mpin(2), munpin(2), plock(2)
  76.  
  77. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  78.      Upon successful completion, the functions _mmmm_llll_oooo_cccc_kkkk and _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk return 0,
  79.      otherwise, they return -1 and set _eeee_rrrr_rrrr_nnnn_oooo to indicate the error.
  80.  
  81. WWWWAAAARRRRNNNNIIIINNNNGGGG
  82.      The functions _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk and _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn provide similar
  83.      functionality.  The major difference between the two sets is that
  84.      _mmmm_pppp_iiii_nnnn_////_mmmm_uuuu_nnnn_pppp_iiii_nnnn maintains a per page lock counter and _mmmm_llll_oooo_cccc_kkkk_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk does not.
  85.      Developers should choose the set that best suites their application and
  86.      stick with it, as mixing the interfaces may result in unexpected
  87.      behavior.
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.